As to a master cylinder unit (a brake hydraulic device for a vehicle) to be used in a brake system for a vehicle, there exists a device including a master cylinder to convert an input to a brake operation element into the brake hydraulic pressure, an electromagnetic valve to open and close a hydraulic pressure path disposed in a base body of the master cylinder, an electromagnetic coil to drive the electromagnetic valve, a pressure sensor to detect intensity of the hydraulic pressure of the brake fluid in the hydraulic pressure path, and a housing having a housing chamber for accommodating the electromagnetic valve, the electromagnetic coil, and the pressure sensor (for example, refer to the patent document 1).